import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text, Image } from '@tarojs/components'
import { Header } from '../common/header';
import { AtIcon } from 'taro-ui'
import '../../icon.scss';
import './login.scss';
import './bind.scss';
import '../common/header.scss';
import { wxUserInfo } from '../utils/common';

export class Login extends Component {

  componentDidMount () {
  }

  getUserInfo = () => {
    wxUserInfo();
  }

  render () {
    return (
      <View>
        <Header title='授权'></Header>
        <View className='bind-user'>
            <View className='bind-user-image'>
                <Image src="http://images.guoxiaoge.cn/108.png" mode='widthFix' />
            </View>
            <View className='bind-user-name'>果小贱</View>
            <View className='bind-user-notice'>该程序将获得以下授权</View>
            <View className='bind-user-notice'>将获得您的公开信息（昵称、头像等）</View>
          </View>
        <View className="auth-button">
          <Button open-type="getUserInfo" onGetUserInfo={this.getUserInfo}>
            <AtIcon prefixClass='icon' value='weixin' size='22' color='#fffff'></AtIcon>
            <Text>授权登录</Text>
          </Button>
        </View>
      </View>
    )
  }
}
